<?php
	class QSource_System_Language_Translate {
		//Function process translate
		public function _($text) {
			$model = new Model_Language_Language();
			$urlFile = QSource_System_Helper_Helper::getFileUrl($text);	
			$defaultlang = $model->getItemLangDefault();	
			$lang = Zend_Controller_Front::getInstance()->getRequest()->getParam('lang',$defaultlang['alias']);
			if(!file_exists($text))
			{
				$translate = new Zend_Translate(array('adapter' => 'ini',
	        	'content' => $urlFile,
	       	 	'locale'  => $lang));
				return $translate->_($text);

			}
			else
			{
				return $text;
			}
		}
		
	}